/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fatclientnbp;

import AirLine.Booking;
import Model.Trip;
import java.util.ArrayList;

/**
 *
 * @author smulle
 */
public class MainController {
    
    
    
    private MainModel model;
    
    
    public MainController(MainModel model){
        this.model = model;
    }

    public void search(SearchParameters s){
        model.setSearchParameters(s);
        model.setState(MainModel.SELECT_STATE);
    }
    

    public void tripChosen(Trip chosenTrip) {
        model.setTrip(chosenTrip);
        model.setState(MainModel.BOOK_STATE);
    }
    
    
    
    public void book(ArrayList<Booking> b){
        model.book(b);
        model.setState(MainModel.FINISHED_STATE);
    }

    void start() {
        model.setState(MainModel.SEARCH_STATE);
    }

}
